package com.dhxt.springcloud.controller;


import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONArray;
import com.dhxt.springcloud.entity.User;
import com.dhxt.springcloud.service.UserService;

@RestController
@RequestMapping(value="/user")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping(value="/findAll")
	public String TestJpa(HttpServletRequest request,HttpServletResponse response){
		List<User> list = userService.findAll();
		return JSONArray.toJSONString(list);
	}
	
	
}